package com.sayice.gomoku.pojo;

import com.alibaba.fastjson.JSON;
import com.sayice.gomoku.game.Action;

/**
 * 消息 (服务器发往客户端)
 */
public class MsgInfo {
    /**
     * 执行的操作
     */
    public final Action action;
    
    /**
     * 消息数据
     */
    public final Object data;
    
    public MsgInfo(Action action, Object data) {
        this.action = action;
        this.data = data;
    }
    
    public String toJson() {
        return JSON.toJSONString(this);
    }
}
